<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Ajax extends CI_Controller
{


    /**
     * @param $pid
     */
    public function loadSubType($pid)
    {
        $this->load->model("Article_Type_Model");
        $types = $this->Article_Type_Model->loadByPid($pid);
        if (count($types) > 0) {
            $this->_print(json_encode($types));
        }
        $this->_print(json_encode(array()));


    }

    public function getCurrentUser()
    {
        $this->load->library('session');
        $user = $this->session->userdata('user');
        $this->_print(json_encode(array("nickname" => 'admin')));
    }
}